//
//  WJProxy.m
//  MultipleInheritanceDemo
//
//  Created by apple on 2018/1/4.
//  Copyright © 2018年 WJ. All rights reserved.
//

#import "WJProxy.h"

@implementation WJProxy
- (id)transformToObject:(NSObject *)object{
    self.object = object;
    return self.object;
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel{
    NSMethodSignature *signature ;
    if(self.object){
        signature = [self.object methodSignatureForSelector:sel];
    }else{
        signature = [super methodSignatureForSelector:sel];
    }
    return signature;
}
- (void)forwardInvocation:(NSInvocation *)invocation{
    if(self.object){
        [invocation setTarget:self.object];
        [invocation invoke];
    }else{
        [super forwardInvocation:invocation];
    }
}
@end
